using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace AppExtensions.Helpers
{
    public static class Singleton<T1, T2> where T2 : IBuilder<T1>, new()
    {
        static T1 instance;
        
        static Singleton()
        {
            IBuilder<T1> builder = new T2();
            instance = builder.Build();
        }

        public static T1 Instance
        {
            get
            {
                return instance;
            }
        }
    }
}
